package com.example.fw;

import java.util.ArrayList;
import java.util.List;



public class Folders {

private List<String> storredFolders = null;
	
	public Folders (List<String> folders) {
		this.storredFolders = new ArrayList<String>(folders);
	}

	public Folders withAdded(String folder) {
		Folders newList = new Folders(storredFolders);
		newList.storredFolders.add(folder);
		return newList;
	}
	public Folders withDeleted(int i) {
        Folders newList = new Folders(storredFolders);
        newList.storredFolders.remove(i);
        return newList;
}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((storredFolders == null) ? 0 : storredFolders.hashCode());
		return result;
	}

	@Override
	public String toString() {
		return "Folders [" + storredFolders + "]";
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		Folders other = (Folders) obj;
		if (storredFolders == null) {
			if (other.storredFolders != null) {
				return false;
			}
		} else if (!storredFolders.equals(other.storredFolders)) {
			return false;
		}
		return true;
	}



}